home *** CD-ROM | disk | FTP | other *** search
- // MainFrm.cpp : implementation of the CMainFrame class
- //
-
- #include "stdafx.h"
- #include "Banner.h"
- #include "MainFrm.h"
-
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- // Array tbSTDButton contains relevant buttons of bitmap IDB_STD_SMALL_COLOR
-
-
- /////////////////////////////////////////////////////////////////////////////
- // CMainFrame
-
- IMPLEMENT_DYNCREATE(CMainFrame, CFrameWnd)
-
- BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
- //{{AFX_MSG_MAP(CMainFrame)
- ON_WM_CREATE()
- ON_WM_DESTROY()
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
-
- /////////////////////////////////////////////////////////////////////////////
- // CMainFrame construction/destruction
-
- CMainFrame::CMainFrame()
- {
- }
-
- CMainFrame::~CMainFrame()
- {
- }
-
- int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
- {
- if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
- return -1;
-
- if(!m_wndCommandBar.Create(this) ||
- !m_wndCommandBar.InsertMenuBar(IDR_MAINFRAME))
- {
- TRACE0("Failed to create CommandBar\n");
- return -1; // fail to create
- }
-
- // Create a combo box and attach it to our own CComboBox derivitive
- CComboBox* pCB = m_wndCommandBar.InsertComboBox(m_wndZoomList.GetWidth(), 1001);
- if(pCB == NULL)
- {
- TRACE0("Failed to create combo box\n");
- return -1; // fail to create
- }
-
- HWND hWndCB = pCB->m_hWnd;
- pCB->Detach();
- m_wndZoomList.Attach(hWndCB);
- m_wndZoomList.Initialize();
-
- // Add Exit button
- if (!m_wndCommandBar.AddAdornments())
- {
- TRACE0("Failed to add adornment\n");
- return -1; // fail to create
- }
-
- return 0;
- }
-
- BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
- {
- return CFrameWnd::PreCreateWindow(cs);
- }
-
- /////////////////////////////////////////////////////////////////////////////
- // CMainFrame diagnostics
-
- #ifdef _DEBUG
- void CMainFrame::AssertValid() const
- {
- CFrameWnd::AssertValid();
- }
-
- void CMainFrame::Dump(CDumpContext& dc) const
- {
- CFrameWnd::Dump(dc);
- }
-
- #endif //_DEBUG
-
- /////////////////////////////////////////////////////////////////////////////
- // CMainFrame message handlers
-
-
- void CMainFrame::OnDestroy()
- {
- m_wndZoomList.Detach();
- CFrameWnd::OnDestroy();
- }
-